import request from '@/utils/request'
// 专业分类 API接口
const std_categoryApi = {
    list: '/std_category/list',
    save: '/std_category/save',
    view: '/std_category/view',
    del: '/std_category/delete',
    dels: '/std_category/batchDel',
    output: '/std_category/output',
    exportExcelTemplate: '/std_category/exportExcelTemplate',
    importExcel: '/std_category/importExcel'
}

/**
 * 导入专业分类Excel
 */
export function importExcel(data) {
  var body = new FormData()
  body.append("file", data);
  return request({
    url: std_categoryApi.importExcel,
    headers: {"Content-Type": "multipart/form-data"},
    method: 'post',
    data: body
  })
}

/**
 * 导出专业分类Excel模板
 */
export function exportExcelTemplate () {
    return request({
        url: std_categoryApi.exportExcelTemplate,
        method: 'post',
        responseType: 'blob'
    })
}

/**
 * 导出专业分类
 */
export function output (data) {
    return request({
        url: std_categoryApi.output,
        method: 'post',
        data: data ,
        responseType: 'blob'
    })
}
/**
 * 批量删除专业分类
 * @param {*} ids
 */
export function delStd_categorys (ids) {
    return request({
        url: std_categoryApi.dels,
        method: 'post',
        params: {ids}
    })
}
/**
 * 删除专业分类
 * @param {*} id
 */
export function delStd_category (id) {
    return request({
        url: std_categoryApi.del,
        method: 'post',
        params: {id}
    })
}
/**
 * 查看、编辑专业分类
 * @param {*} id
 */
export function viewStd_category (id) {
    return request({
        url: std_categoryApi.view,
        method: 'get',
        params: {id}
    })
}
/**
 * 保存专业分类
 * @param {*} body
 */
export function saveStd_category (body) {
    return request({
        url: std_categoryApi.save,
        method: 'post',
        data: body
    })
}
/**
 * 查询专业分类列表
 * @param {*} body
 */
export function queryStd_categoryList (body) {
    return request({
        url: std_categoryApi.list,
        method: 'post',
        data: body
    })
}